
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
markdown-it-sub
Advanced tools
The markdown-it-sub package is a plugin for the markdown-it Markdown parser that adds support for subscript text. This allows users to include subscript text in their Markdown documents, which is useful for scientific notation, chemical formulas, and other contexts where subscript text is needed.
Subscript Text
This feature allows you to render subscript text in Markdown. By using the tilde (~) syntax, you can convert text to subscript. In the example, 'H~2~O' is converted to 'H<sub>2</sub>O'.
const md = require('markdown-it')();
const sub = require('markdown-it-sub');
md.use(sub);
const result = md.render('H~2~O');
console.log(result); // Outputs: <p>H<sub>2</sub>O</p>
The markdown-it-sup package is a plugin for the markdown-it Markdown parser that adds support for superscript text. It is similar to markdown-it-sub but focuses on superscript text instead of subscript. It uses the caret (^) syntax to convert text to superscript.
The markdown-it-attrs package allows you to add attributes to Markdown elements. While it does not specifically focus on subscript or superscript text, it provides a more general solution for adding custom attributes to any Markdown element, which can include styling for subscript or superscript.
The markdown-it-footnote package adds footnote support to the markdown-it parser. While it is not directly related to subscript text, it provides another way to include additional information in a Markdown document, similar to how subscript text is used to provide additional context.
Subscript (
<sub>
) tag plugin for markdown-it markdown parser.
H~2~0
=> H<sub>2</sub>O
Markup is based on pandoc definition. But nested markup is currently not supported.
node.js, browser:
npm install markdown-it-sub --save
bower install markdown-it-sub --save
var md = require('markdown-it')()
.use(require('markdown-it-sub'));
md.render('H~2~0') // => '<p>H<sub>2</sub>O</p>'
Differences in browser. If you load script directly into the page, without
package system, module will add itself globally as window.markdownitSub
.
FAQs
<sub> tag for markdown-it markdown parser.
We found that markdown-it-sub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.